// Blur()
function __blur__()
{
	this.blur(); 
}

// Namespace
var iRing = null;
if ( !iRing )
{
	iRing = {};
	iRing.version = "1.0.0.1001";

}


// Open a URL in the user's default browser;
iRing.openUrl = function(url) {
	external.openUrl( url );
}

// 
iRing.loadString = function(path) {
	var str = external.loadString(path);
	return str;
}

iRing.cache = function(path) {
	if ( !iRing.cache.m )
	{
		iRing.cache.m = {};
	}
	// ...
}

// Load new CSS style, re-rendering the HTML
iRing._addCSS = function(fileName) {
	var head = document.getElementsByTagName('head')[0];
	css = document.createElement('link');
	css.setAttribute('rel', 'stylesheet');
	css.setAttribute('type', 'text/css');
	css.setAttribute('href', fileName);
	head.appendChild(css);
}

iRing.updateStyle = function(path) {
	iRing._addCSS(path + "\\main.css");
	if ($.browser.version == '6.0')
	{
		iRing._addCSS(path + "\\main.ie6.css");
	}
}


iRing.addSchedule = function(a1, a2, timeObj, type, desc){
	function timeObj2Str(timeObj)
	{
		return null;
	}
	var timeStr = timeObj2Str(timeObj);
	return external.addSchedule(a1, a2, timeStr, type, desc);
}

// Callback
function __CB__(func)
{
	if (!__CB__.$array)
	{
		 __CB__.$array = {};
	}
	var dt = new Date();
	var cookie = dt.getTime() + "-" + Math.random();
	delete dt;
    __CB__.$array[cookie] = func;
	return cookie;
}

iRing.callback = function(cookie, params)
{
	if (!__CB__.$array)
	{
		return;
	}
	var func = __CB__.$array[cookie];
	func(params);
	delete __CB__.$array[cookie];
}


